package com.woniuxy.direct.controller;

import com.woniuxy.direct.service.DirectService;
import com.woniuxy.po.TopicMail;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
public class DirectController {
    @Resource
    DirectService directService;
    @RequestMapping("direct")
    @ResponseBody
    public void directSend(@ModelAttribute("mail")TopicMail topicMail) {
        directService.sendMessage(topicMail);
    }
}
